package account_type

const (
    StateUnknown  = iota
    StateActive
    StateSuspend
    StateUnactive
)

const (
    AuthTypeUnkown = iota
    AuthTypeNamePass
    AuthTypePhonePass
    AuthTypeEmailPass
    AuthTypeWXOpenID
    AuthTypeAdminPass
)

const (
    AccountLogUnknown = iota
    AccountRegister
    AccountLoginOK
    AccountLoginFailed
    AccountChangePasswordOK
    AccountChangePasswordFailed
)

const (
    ResourceTypeAPI  = ""
    ResourceTypeMenu = "ui"
)

var lut = [...]string{
    AuthTypeUnkown:    "unknown",
    AuthTypeNamePass:  "name_pass",
    AuthTypePhonePass: "phone_pass",
    AuthTypeEmailPass: "email_pass",
    AuthTypeWXOpenID:  "wxopenid",
}

func AuthTypeString(t int) string {
    if t > len(lut)-1 {
        return ""
    }
    return lut[t]
}

func AuthTypeInt(s string) int {
    for i, v := range lut {
        if s == v {
            return i
        }
    }
    return 0
}

var (
    AdminName = "系统管理员"
)
